Longest path problem